<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="add">添加</button>
       <ul>
        <li v-for="item,index in arr" :key="item">{{item}}</li>
       </ul>
    </div>
    <script>
        new Vue({
            el:'#app', //指定绑定的盒子，这个盒子的数据都由这个Vue管理
            data:{
                arr:['html','css',"javascript"]
            },
            methods:{
                add() {
                    this.arr.unshift('vue')
                }
            }
        })
    </script>
</body>
</html>